package com.lemon.reggie.async;

import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;

import java.lang.reflect.Method;

@Slf4j
public class MyAsyncExceptionHandler implements AsyncUncaughtExceptionHandler {

    @Override
    public void handleUncaughtException(Throwable throwable, Method method, Object... objects) {
        log.info("------全局线程池异常处理-----");
        log.info("------error fillInStackTrace:" + throwable.fillInStackTrace());
        log.info("------error message:" + throwable.getMessage());
        log.info("------error methodName:" + method.getName());
        for (Object param : objects)
        {
            log.info("------param:" + param);
        }
    }
}

